"""
@Filename       : twitter_preprocess.py
@Create Time    : 2021/3/16 14:51
@Author         : Rylynn
@Description    : 

"""
import os
import pandas as pd


def load_graph(rootpath, file):
    filepath = os.path.join(rootpath, file)
    f = open(filepath, 'r+')
    sql = ''.join(f.readlines())
    # pd.read_sql(sql)


def load_diffusion_data(rootpath, file):
    filepath = os.path.join(rootpath, file)
    df = pd.read_csv(filepath)
    group = df.groupby(['id'])
    print(group.head(1))

if __name__ == '__main__':
    load_graph('F:/data/diffusion/twitter', 'active_follower_real.sql')
    load_diffusion_data('F:/data/diffusion/twitter', 'link_status_search_with_ordering_real.csv')